<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // const person1 = {
    //   name: "jack",
    //   age: 21,
    //   language: ["java","js","css"]
    // }
    //
    // console.log(Object.keys(person1))
    // console.log(Object.values(person1))
    // console.log(Object.entries(person1))

    const target = { a: 1};
    const source1 = {b:2};
    const source2 = {c:3};

    console.log(Object.assign(target,source1,source2))

    let person = {name:"Amy",age:18}


    let someone = { ...person}
    console.log(someone)

    let person3 = {
      name: "jack",
      eat: function (food) {
        console.log(this.name+"在吃"+ food);
      },
      eat2: food => console.log(person3.name+"在吃"+food),
      eat3(food){
        console.log(this.name+"在吃"+food)
      }
    }

    person3.eat("香蕉")
    person3.eat2("苹果")
    person3.eat3("桃子")

    let name1={name:"asd"}
    let age1={age:15}
    let p={...name1,...age1}
    console.log(p)


</script>
</body>
</html>
